/**
 * 玩安卓api
 */
export class PlayAndroidApi {
  /**
   * 登录
   */
  static login(userName: string, password: string): string {
    return `https://www.wanandroid.com/user/login?username=${userName}&password=${password}`
  }
  /**
   * 首页 banner
   */
  static banner: string = "https://www.wanandroid.com/banner/json"
  /**
   * 首页文章列表
   */
  static article: string = "https://www.wanandroid.com/article/list/0/json"
}

/**
 * 天气预报的api
 */
export class WeatherApi {
  /**
   * 获取天气的api
   */
  private static weatherNowApi: string = "https://devapi.qweather.com/v7/weather/now"
  /**
   * 获取未来24小时天气
   */
  private static weatherFutureHour: string = "https://devapi.qweather.com/v7/weather/24h"
  /**
   * 获取未来7天的天气
   */
  private static weatherFutureDay: string = "https://devapi.qweather.com/v7/weather/7d"

  /**
   * 天气指数
   */
  private static weatherIndex: string = "https://devapi.qweather.com/v7/indices/1d"

  /**
   * 热门城市
   */
  private static hotCity: string = "https://geoapi.qweather.com/v2/city/top"

  /**
   * key
   */
  private static key: string = "8a91c756f215451fb89b60c73fe9df3b"

  /**
   * 获取当前天气接口
   * @param location
   * @returns
   */
  static getWeatherForNowApi(location: string): string {
    return `${this.weatherNowApi}?location=${location}&key=${this.key}`
  }

  /**
   * 获取未来24小时天气
   * @param location
   * @returns
   */
  static getWeatherForHourApi(location: string): string {
    return `${this.weatherFutureHour}?location=${location}&key=${this.key}`
  }

  /**
   * 获取未来十天的天气
   * @param location
   * @returns
   */
  static getWeatherForDayApi(location: string): string {
    return `${this.weatherFutureDay}?location=${location}&key=${this.key}`
  }

  /**
   * 获取天气指数
   * 1、运动指数
   * 2、洗车指数
   * 3、穿衣指数
   * 4、钓鱼指数
   * @param location
   * @returns
   */
  static getWeatherIndexApi(location: string): string {
    return `${this.weatherIndex}?type=1,2,3,4&location=${location}&key=${this.key}`
  }

  /**
   * 获取热门城市
   */
  static getHotCityApi(): string {
    return `${this.hotCity}?number=20&range=cn&key=${this.key}`
  }
}

